﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace Mrsoft.SSC.Model
{
    class SecretCard
    {
        public SecretCard(string serialId, List<Password> passwordList) {
            this.SerialId = serialId;
            this.PasswordsList = passwordList;
            foreach (var password in passwordList) {
                passwordDic.Add(string.Format("{0}{1}", password.RowId, password.ColumnId), password.KeyValue);
            }
        }


        public string SerialId { set; get; }

        public List<Password> PasswordsList { get; set; }

        private Dictionary<string, string> passwordDic = new Dictionary<string, string>();

        public string GetValue(string columnId, string rowId) {
            return passwordDic[string.Format("{0}{1}", columnId, rowId)];
        }
    }
}
